from bin.common_fun import Common
import logging.config
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException

from bin.desired_caps import appium_desired

class LoginView(Common):
    numBtn = (By.ID , 'com.sykean.biometrics:id/btn_key_6')
    def login_action(self):
        self.check_loginBtn()
        logging.info('input password')
        try:
            element = self.driver.find_element(*self.numBtn)
        except NoSuchElementException:
            logging.info('登录按键未成功加载出')
        else:
            for i in range(6):
                element.click()


if __name__ == '__main__':
    driver = appium_desired()
    L = LoginView(driver)
    while True:
        L.login_action()
